﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AccidentalNoise
{
    public class ScaleOffset : ModuleBase
    {
        ScalarParameter scale, offset;

        public ScaleOffset(ModuleBase mbase, double scale, double offset)
        {
            this.scale = new ScalarParameter(scale);
            this.offset = new ScalarParameter(offset);
            this.Source = mbase;
        }

        public override double Get(double x, double y)
        {
            return Source.Get(x, y) * scale.Get(x, y) + offset.Get(x, y);
        }

        public override double Get(double x, double y, double z)
        {
            return Source.Get(x,y,z) * scale.Get(x, y, z) + offset.Get(x, y, z);
        }
    }
}
